package com.crm.dao.mapper.customMapper.activityManagerCustomMapper;

import com.alibaba.fastjson.JSONArray;
import com.crm.model.entity.customerManager.Customer;
import com.crm.model.qo.activityManager.CustomerProductActivityQO;
import com.crm.model.qo.activityManager.CustomerProductGiftActivityQO;
import com.crm.model.vo.activityManager.CustomerProductGiftActivityContractVO;
import com.crm.model.vo.activityManager.CustomerProductGiftActivityVO;
import com.crm.model.vo.activityManager.CustomerProductGiftDetailVO;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

/**
 * @Author yincuimei
 * @Date 2021/3/1 15:47
 */
public interface CustomerProductGiftActivityCustomMapper {

    /**
     * 活动管理--赠品活动列表
     * @param customerProductGiftActivityQO --赠品列表查询条件
     * @param sortOrder --排序
     * @Author yincuimei
     * @return
     */
    List<CustomerProductGiftActivityVO> selectCustomerProductGiftActivityVOList(@Param("customerProductGiftActivityQO")CustomerProductGiftActivityQO customerProductGiftActivityQO, @Param("sortOrder")String sortOrder);

    /**
     * 赠品活动列表--(赠品活动上架判断)根据赠品活动ID查询活动是否在有效期内
     * @param productGiftActivityId  ---赠品活动ID
     * @Author yincuimei
     * @return
     */
    int selectGiftActivityIsInValidityPeriod(@Param("productGiftActivityId")String productGiftActivityId,@Param("nowDate")String nowDate);

    /**
     * 赠品活动列表--查看产品类赠品活动(根据赠品活动ID查看赠品活动)关联会员产品
     * @return
     */
    CustomerProductGiftDetailVO selectMemberProductCategoryGiftActivityById(@Param("productGiftActivityId")String productGiftActivityId);

    /**
     * 赠品活动列表--查看产品类赠品活动(根据赠品活动ID查看赠品活动)关联非会员产品
     * @return
     */
    CustomerProductGiftDetailVO selectNonMemberProductCategoryGiftActivityById(@Param("productGiftActivityId")String productGiftActivityId);

    /**
     * 根据产品idList查询对应的赠品列表
     * @param selectProductGiftListByProductIdList 产品idList
     * @param price 价钱
     * @return
     */
    List<CustomerProductGiftActivityContractVO> selectProductGiftListByProductIdAndPrice(@Param("selectProductGiftListByProductIdList") JSONArray selectProductGiftListByProductIdList, @Param("price") BigDecimal price);
}
